<!-- eslint-disable vue/multi-word-component-names -->
<script setup>
import { useNotePageStore } from '@/stores'
import { useRouter } from 'vue-router'
let router = useRouter()
let noteStore = useNotePageStore()
// 去往图片上传组件
function uploadImg() {
  // 更改跳转状态
  props.flag ? noteStore.setPageState(!noteStore.pageState) : ''
  props.path ? router.push(props.path) : ''
}
// 传参要求
let props = defineProps({
  flag: {
    type: Boolean,
    required: false,
    default: false
  },
  path: { type: String, required: false, default: '' }
})
</script>

<template>
  <button class="publishBtn" @click="uploadImg">
    <slot>文字占位</slot>
  </button>
</template>
<style lang="scss" scoped>
.publishBtn {
  padding: 20px;
  border-radius: 5px;
  border: 1px solid #ffffff;
  background-color: #fff;
  margin-right: 40px;
  color: #42d392;
}
.publishBtn:hover {
  border-color: #f0f0f0;
  cursor: pointer;
  background-color: #f0f0f0;
}
</style>
